package com.atguigu.config;

import com.atguigu.Interceptors.LoginProtectInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMVCConfig  implements WebMvcConfigurer {
    @Autowired
    private LoginProtectInterceptor LoginProtectInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(LoginProtectInterceptor).addPathPatterns("/headline/**");
    }
}
